@layout("/common/_curd/_container.html"){

<script type="text/javascript">
	var ctx = "${basePath}";
	var grid_selector = "#grid-table";
	var pager_selector = "#grid-pager";
	
	$(function(){
		initGrid();
//		initMenuBtn("btns", "${code}");
	});
	
	function initGrid(){
		var grid_url = ctx + "/${code}/graduate_detail_list";
		var _colnames = ["ID",
						"姓名",
                        "电话号码",
                        "校讯通",
                        "父亲姓名",
						"父亲电话号码",
            　　　　　　"母亲姓名",
						"母亲电话号码",
                        "其他联系人",
						"其他联系人电话号码"
        ];
		var _colmodel = [{name:"id", index:"id",hidden:true},
						{name:"name", index:"name", width:50},
                        {name:"mobile", index:"class_name", width:100},
                        {name:"last_code", index:"last_code",formatter:fmatterReg, width:50},
                        {name:"parent_name", index:"parent_name", width:50},
                        {name:"parent_mobile", index:"parent_mobile", width:100},
                        {name:"mother_name", index:"mother_name",width:50},
						{name:"mother_mobile", index:"mother_mobile", width:100},
                        {name:"other_name", index:"other_name",width:50},
						{name:"other_mobile", index:"other_mobile", width:100}
        ];

        var value = ${classid};
        var key = "class_id_equal";
        var where = "{\"" + key + "\":\"" + value + "\"}";
		
		jQuery(grid_selector).jqGrid({
			url : grid_url,
		    shrinkToFit : true,
			colNames : _colnames,
			colModel : _colmodel,
            multiselect : false,
			jsonReader : {id :"id"},
			pager : pager_selector,
			postData : {sort : "id", order : "desc",where:encodeURI(where)}
		});
	}
    function fmatterReg(cellvalue, options, rowObject){
        if (cellvalue){
            return '<span class="label label-sm label-success">已注册</span>';
        }else{
            return '<span class="label label-sm label-warning">未注册</span>';
        }
    }

</script>


	<!-- 配置 grid -->
	<div class="row">
		<div class="col-xs-12 tb-grid">
			<!-- 配置 查询 -->
			@ var _col=[
			@		{name:"学生姓名", index:"name", type:"text"},
			@		{name:"家长姓名", index:"pname", type:"text"}
			@];
			@ include("/common/_function/_search2.html",{"col":_col}){}
			<!-- 按钮
			<div class="welljq well-sm" id="btns"></div>-->
			<!-- grid -->
			<table id="grid-table"></table>
			<!-- 分页-->
			<div id="grid-pager"></div>
		</div>
	</div>
	
	<!-- 引入所需的js -->
	@include("/common/_listscript.html"){}
	
@}	